-
Notifications
You must be signed in to change notification settings - Fork 2.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
use run_pip of env in executor #2701
Conversation
This ensures to use the correct python executable. Using `run` simply uses `sys.prefix` with a bin suffix, which is not necessarily the currently used python executable. E.g. when linking a specific python version to a custom directory, using `sys.prefix` may point to the wrong python version: * /usr/bin/python2.7 * /usr/bin/python3.6 * /usr/bin/python is a symlink to 2.7 * /usr/bin/local/python (or any other location) is a symlink to 3.6 which shadows the former symlink `sys.prefix` is `/usr` in this case, which is correct, but the `python` executable there points to the wrong version. `run_pip` in the env fixes this already by using `sys.executable`, see https://github.com/python-poetry/poetry/blob/develop/poetry/utils/env.py#L964 This should be used in the executor as well.
This ensures to use the correct python executable. Using `run` simply uses `sys.prefix` with a bin suffix, which is not necessarily the currently used python executable. E.g. when linking a specific python version to a custom directory, using `sys.prefix` may point to the wrong python version: * /usr/bin/python2.7 * /usr/bin/python3.6 * /usr/bin/python is a symlink to 2.7 * /usr/bin/local/python (or any other location) is a symlink to 3.6 which shadows the former symlink `sys.prefix` is `/usr` in this case, which is correct, but the `python` executable there points to the wrong version. `run_pip` in the env fixes this already by using `sys.executable`, see https://github.com/python-poetry/poetry/blob/develop/poetry/utils/env.py#L964 This should be used in the executor as well.
This ensures to use the correct python executable. Using `run` simply uses `sys.prefix` with a bin suffix, which is not necessarily the currently used python executable. E.g. when linking a specific python version to a custom directory, using `sys.prefix` may point to the wrong python version: * /usr/bin/python2.7 * /usr/bin/python3.6 * /usr/bin/python is a symlink to 2.7 * /usr/bin/local/python (or any other location) is a symlink to 3.6 which shadows the former symlink `sys.prefix` is `/usr` in this case, which is correct, but the `python` executable there points to the wrong version. `run_pip` in the env fixes this already by using `sys.executable`, see https://github.com/python-poetry/poetry/blob/develop/poetry/utils/env.py#L964 This should be used in the executor as well. Co-authored-by: Jonathan Striebel <jstriebel@users.noreply.github.com>
@sdispater I was assuming that the new minor version would be on the |
@jstriebel this was already ported in #2714 the |
This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
This is a bug-fix for the current development branch and ensures to use the correct python executable.
Using
run
simply usessys.prefix
with a bin suffix, which is not necessarily the currently used python executable.E.g. when linking a specific python version to a custom directory, using
sys.prefix
may point to the wrong python version:sys.prefix
is/usr
in this case, which is correct, but thepython
executable there points to the wrong version.run_pip
in the env fixes this already by usingsys.executable
, see https://github.com/python-poetry/poetry/blob/develop/poetry/utils/env.py#L964This should be used in the executor as well.
Thanks for considering this change!